package net.tngou.tpage.action;

import java.io.IOException;
import java.util.Date;
import java.util.Random;

import net.tngou.tpage.enums.CookieEnum;
import net.tngou.tpage.util.CaptchaServiceSingleton;











/**
 * 显示验证码
 * @author PICOHOOD1
 * @since 2012/2/9
 *
 */
public class CaptchaAction extends BaseAction {
	
	
	/**
	 * 显示验证码
	 */
	@Override
	public void execute() throws IOException  {
		String value=new Date().hashCode()+""+ new Random(100).nextInt();
		response.addCookie(CookieEnum.tngou_captacha.name(), value);
		CaptchaServiceSingleton.getInstance().writeCaptchaImage( request, response,session,value);
		   
	}
	

	

}
